package com.gitee.magic.converter;

import java.sql.Time;

import com.gitee.magic.core.converter.AbstractConverterEditor;

/**
 * @author start
 */
public class SqlTimeConverterEditor extends AbstractConverterEditor<Time> {

	public SqlTimeConverterEditor(Class<?> prototype) {
		super(prototype);
	}

	@Override
	public void restore(Object value) {
		if(value!=null) {
			setValue(Time.valueOf(String.valueOf(value)));
		}
	}

	@Override
	public Time converter() {
		if(getValue()!=null) {
			return (Time)getValue();
		}
		return null;
	}

}
